export default defineEventHandler(async (event) => {
    const config = useRuntimeConfig(event)
    console.log('baseURL', config.public.apiBase)
    // console.log('event', event)
    const query = getQuery(event)
    console.log('_query', query)
    const body = await readBody(event)
    console.log('_body', body)
    const cookies = parseCookies(event)
    console.log('_cookies', cookies)
    // 读取counter cookie
    let counter = Number(getCookie(event, 'counter') || 0)
    // 将counter cookie增加1
    setCookie(event, 'counter', String(++counter))
    // 访问公共变量
    return await $fetch(`/api/wnHistoryRecord`, {
        baseURL: config.public.apiBase,
        headers: {
            // 访问私有变量（仅在服务器端可用）
            Authorization: `Bearer ${config.apiSecret}`
        },
        method: "post",
        body
    })
})
